<script type="text/javascript">
    jQuery(document).ready(function(){
        var urls= baseurl+"carts/fetchcart/";
        jQuery("#loader_cart").show("200");
        jQuery.get(urls, function(data) {
            jQuery("#cart_content").html(data);		  
            jQuery("#loader_cart").hide("200");
        });
        //Update quantity in cart	
        /*jQuery('.update_quantity').live("click",function(){		
        var CartID=jQuery(this).attr("CartID");		
        var sellerID=jQuery(this).attr("sellerID");
        sales_tax=jQuery("#SalesTax_"+CartID).html();
        sm_id=jQuery("#shippingmethod_"+CartID).val();
        jQuery("#cart_content").css("opacity","0.15");
        jQuery("#loader_cart").show("200");
        setprice(sm_id,CartID,sellerID);
	
});
         */
        //Remove Item from Cart
        jQuery('.removeCart').live("click",function(){
            if(confirm("Are you sure you want to remove this from the cart?")){
                return true;
            }else{
                return false;
            }
        });	
	
        //Submit form
        jQuery('.update_quantity').live("click",function() {
            formID=jQuery(this).attr("CartID");
            update_cart(formID,"");
            return false;
        })
        jQuery(".processpayment").live("click",function(){
            form_id=jQuery(this).attr("form_id");
            if(jQuery(this).attr("name")=="paypal"){
                //jQuery("form#CartProcessForm_"+form_id).attr("action",baseurl+"carts/order_process");
                jQuery("form#CartProcessForm_"+form_id).attr("action",baseurl+"payments/expressCheckout");
                return true;
            }
            else{
                jQuery("form#CartProcessForm_"+form_id).attr("action",baseurl+"carts/order_process_gcheckout");
                return true;
            }
        });
    });
    //Set price on shipping method change shipping price
    function update_cart(formID,sm_id){
	
        jQuery("#cart_content").css("opacity","0.15");
        jQuery("#loader_cart").show("200");
		
        data=jQuery('#CartUpdatequantityForm_'+formID).serialize();
        url= baseurl+"carts/updatequantity";
        jQuery.ajax({
            type: 'POST',
            url: url,
            data: data,
            dataType: 'json',
            success: function(data){
                if(data.ok=="Yes"){
                    var loadcart= baseurl+"carts/fetchcart/";
                    jQuery.get(loadcart, function(data1) {
                        jQuery("#cart_content").html(data1);
                        jQuery("#loader_cart").hide("200");
                        jQuery("#cart_content").removeAttr("style");
                    });
                    jQuery("#flashMessage").show().fadeIn("200");
                    jQuery("#flashMessage").html(data.msg);
                }else{
                    jQuery("#flashMessage").show().fadeIn("200");
                    jQuery("#flashMessage").html(data.msg);
                    jQuery("#loader_cart").hide("200");
                    jQuery("#cart_content").removeAttr("style");
                }
			
                return false;
            }  
        });
        return false;	
	
    }
</script>

<style type="text/css">
    td p span{color:#00B050;}
    td.vendor h2 {font-size:20px; color: #00B050;}
</style>
<?php
$this->Html->addCrumb('View Cart');
?>
<div id="loader_cart" style="display:none;left: 392px;position: absolute;top: 203px;"><img src="<?php echo Configure::read('base_url'); ?>img/animation_processing.gif" alt="Processing Cart..." style="" /></div>
<div class="title">Your Shopping Cart</div>
<?php //pr($carts_seller); ?>
<div id="flashMessage" class="message_cart" style="display:none"></div>
<div id="cart_content"></div>